<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  // const obj = new Object();
  /*
  const obj = {
    name: 'miranda',
    age: 18,
    run: function () {
      console.log("在运动...");
    },
    eat: function () {
      console.log("在吃饭...");
    }
  };
  */

  // 1.属性的增强写法
  const name = 'miranda';
  const age = 20;
  const height = 1.88;

  // ES5写法
  /*
  const obj = {
    name: name,
    age: age,
    height: height
  };

   console.log(obj);
  */

  // ES6写法
  /*
  const obj = {
    name,
    age,
    height
  };

  console.log(obj);
  */

  // 2.函数的增强写法
  // ES5写法
  /*
  const obj = {
    run: function () {

    },
    eat: function () {

    }
  }
  */

  // ES6写法
  const obj = {
    run() {

    },
    eat() {

    }
  }
</script>
</body>
</html>